core: Fix duplication bug in _ostree_detached_metadata_append_gpg_sig()
authorMatthew Barnes <mbarnes@redhat.com>
Mon, 2 Mar 2015 19:43:41 +0000 (14:43 -0500)
committerMatthew Barnes <mbarnes@redhat.com>
Mon, 2 Mar 2015 20:13:49 +0000 (15:13 -0500)
commitc107561171b976778eaf200a336234884e45173b
treed42f24051ade761c2cff6394199606b1733dfb78
parentc04f9f47e3ca3b51c84eb71013ced524a2d659ba
core: Fix duplication bug in _ostree_detached_metadata_append_gpg_sig()

g_variant_builder_add() does not replace identical keys in a VARDICT
variant, so signing a commit multiple times results in multiple copies
of "ostree.gpgsigs" in the metadata.  And since g_variant_lookup_value()
stops on the first match, subsequent signatures have no net effect.

Instead of GVariantBuilder use GVariantDict, which behaves more like a
hash table.
src/libostree/ostree-core.c